package org.jb.coinche.client.business.model;

import org.jb.coinche.client.business.model.Player.Team;
import org.jb.coinche.client.guistatemachine.AbstractState;

public class Round extends AbstractState implements GameState {

	/**
	 * 
	 */
	private static final long serialVersionUID = 295813343156329511L;
	/**
	 * @param auction the auction to set
	 */
	public void setAuction(Auction auction) {
		this.auction = auction;
	}

	/**
	 * @return the auction
	 */
	public Auction getAuction() {
		return auction;
	}
	
	/**
	 * @param game the game to set
	 */
	public void setGame(Game game) {
		this.game = game;
	}

	/**
	 * @return the game
	 */
	public Game getGame() {
		return game;
	}
	
	/*
	 * 
	 */
	public void addScoreDixDeDer(Team team) {
		if (team == Player.Team.T1) {
			team1_score += 10;
		} else {
			team2_score += 10;
		}
		
	}
	
	/*
	 * 
	 */
	public void addScore( Player.Team team, int score ) {
		if (team == Player.Team.T1) {
			team1_score += score;
		} else {
			team2_score += score;
		}
	}
	
	public int getScore1() {
		return team1_score;
	}
	
	public int getScore2() {
		return team2_score;
	}
		
	/*
	 * 
	 */
	public boolean isFinished() {
		return game.getPlayers().get(0).getCards().isEmpty();
	}
	
	private Auction auction;
	private Game game;
	private int team1_score = 0;
	private int team2_score = 0;
	
}
